package com.ten_4_4.hiring.comm.util;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public abstract class CommUtil {
	
	public static HttpSession getSession(HttpServletRequest request) {
		if(request != null) {
			return request.getSession();
		}
		return null;
	}
	public static Object getAttributeFromSession(HttpServletRequest request, String key) {
		return getSession(request).getAttribute(key);
	}
	public static void removeAttributeFromSession(HttpServletRequest request, String key) {
		if(getAttributeFromSession(request, key) != null) {
			getSession(request).removeAttribute(key);
		}
	}

}
